<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
    <link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico">
    <title>Preclinic - Medical & Hospital - Bootstrap 4 Admin Template</title>
    <link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">
    <!--[if lt IE 9]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
	<![endif]-->
</head>

<body>
            <div class="content">
                <div class="row">
                    <div class="col-sm-5 col-5">
                        <h4 class="page-title">部门</h4>
                    </div>
                    <div class="col-sm-7 col-7 text-right m-b-30">
                        <a href="add-department.html" class="btn btn-primary btn-rounded"><i class="fa fa-plus"></i> 添加部门</a>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="table-responsive">
                            <table class="table table-striped custom-table mb-0 datatable">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>部门名称</th>
                                        <th>状态</th>
                                        <th class="text-right">操作</th>
                                    </tr>
                                </thead>
                                <tbody id="department">
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
    <script src="assets/js/jquery-3.2.1.min.js"></script>
	<script src="assets/js/popper.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/jquery.dataTables.min.js"></script>
    <script src="assets/js/dataTables.bootstrap4.min.js"></script>
    <script src="assets/js/jquery.slimscroll.js"></script>
    <script src="assets/js/app.js"></script>
	<!--json data-->
	<script type="text/javascript" src="json/department.json"></script>
	<script type="text/javascript">
	$(document).ready(function () {
		var departmentStr = "";
		for(var i = 0; i < department.length; i++){			
			departmentStr = departmentStr + '<tr>';
            departmentStr = departmentStr + '<td>'+ (i + 1) +'</td>';
            departmentStr = departmentStr + '<td>'+ department[i].name +'</td>';
			
			departmentStr = departmentStr + '<td><span class="custom-badge status-green">Active</span></td>';
			
            departmentStr = departmentStr + '<td class="text-right">';
            departmentStr = departmentStr + '<div class="dropdown dropdown-action">';
            departmentStr = departmentStr + '<a href="#" class="action-icon dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-ellipsis-v"></i></a>';
            departmentStr = departmentStr + '<div class="dropdown-menu dropdown-menu-right">';
            departmentStr = departmentStr + '<a class="dropdown-item" href="edit-department.html"><i class="fa fa-pencil m-r-5"></i> Edit</a>';
            departmentStr = departmentStr + '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#delete_department"><i class="fa fa-trash-o m-r-5"></i> Delete</a>';
            departmentStr = departmentStr + '</div>';
            departmentStr = departmentStr + '</div>';
            departmentStr = departmentStr + '</td>';
            departmentStr = departmentStr + '</tr>';
		}
		$("#department").html(departmentStr);		
	});
	</script>
</body>

</html>